-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InterceptMessage
cleanup
#1339
base: main
Are you sure you want to change the base?
InterceptMessage
cleanup
#1339
Conversation
b5e6e91
to
85433a8
Compare
Bencher Report
Click to view all benchmark results
|
Bencher Report
Click to view all benchmark results
|
Bencher Report
🚨 1 Alert
Click to view all benchmark results
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1339 +/- ##
=======================================
Coverage 19.14% 19.14%
=======================================
Files 166 166
Lines 10987 10987
=======================================
Hits 2104 2104
Misses 8883 8883
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just added a nit
@@ -47,10 +47,10 @@ enum SnifferError { | |||
/// In order to alter the messages sent between the roles, the [`Sniffer::intercept_messages`] | |||
/// field can be used. It will look for the [`InterceptMessage::expected_message_type`] in the | |||
/// specified [`InterceptMessage::direction`] and replace it with | |||
/// [`InterceptMessage::response_message`]. | |||
/// [`InterceptMessage::replace_message`]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea in practice response_message
can also be request_message
, I agree this is confusing.
Maybe we should use replacement_message
? replace_message
feels more like a function name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -80,14 +75,12 @@ impl InterceptMessage { | |||
expected_message_type: MsgType, | |||
replace_message: PoolMessages<'static>, | |||
replace_message_type: MsgType, | |||
break_on: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont mind removing this tbh. It was added because it can be useful to decide to stop the connection between two roles when a specific message is exchanged. Some of those cases are now covered by the check_on_drop
flag thus I think it is cool to remove it.
this is a misleading name, as this is not really a response, but rather the new message to replace the intercepted one
it's not fully designed and motivation is not clear, we can re-design if needed
we need 2 sniffers to assert the message was correctly replaced and fully delivered over the TCP connection
85433a8
to
f7f58fd
Compare
close #1338